var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
_decorator.property;

var _def_Logic_ChildMoveEvent = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.cantClick = true;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.onLoad = function () {
    this.AddEvent();
  };
  _creator.prototype.AddEvent = function () {
    this.node.on(cc.Node.EventType.TOUCH_START, this.onChildTouchStart, this);
    this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onChildTouchMove, this);
    this.node.on(cc.Node.EventType.TOUCH_END, this.onChildTouchUp, this);
    this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.onChildTouchUp, this);
  };
  _creator.prototype.StartSet = function (e, t, o) {
    this.touchStart = e;
    this.touchMove = t;
    this.touchUp = o;
  };
  _creator.prototype.onChildTouchStart = function (e) {
    this.cantClick && this.touchStart && this.touchStart(e);
  };
  _creator.prototype.onChildTouchMove = function (e) {
    this.cantClick && this.touchMove && this.touchMove(e);
  };
  _creator.prototype.onChildTouchUp = function (e) {
    this.cantClick && this.touchUp && this.touchUp(e);
  };
  _creator.prototype.offEvent = function () {
    this.node.targetOff(this);
  };
  _creator.prototype.SetDelayCantClick = function (e) {
    var t = this;
    this.cantClick = false;
    this.scheduleOnce(function () {
      t.cantClick = true;
    }, e);
  };
  _creator.prototype.SetCantClick = function (e) {
    this.cantClick = e;
    this.offEvent();
    e && this.AddEvent();
  };
  return __decorate([_ccclass], _creator);
}(cc.Component);
exports.default = _def_Logic_ChildMoveEvent;